Skip to content

Conversation

@lishunyao97
Copy link

@lishunyao97 lishunyao97 commented Jul 21, 2025

Why are these changes needed?

[PyTorch 2.6 perf fix]
The ray monitoring process agent.py runs periodic memory stats collection which used an expensive low-level kernel call (ray callsite) caused the training process to stall. Removing the expensive kernel call fixed the regression on PyTorch 2.6.

Related issue number

The call was noticed to be expensive in 2019
Reduce reporter CPU by ericl · Pull Request #6553 · ray-project/ray

then un-noticed in 2022
[Core] Export additional metrics for workers and Raylet memory by mwtian · Pull Request #25418 · ray-project/ray

As a next step, we would like to contribute to Ray OSS by exposing allowed metrics as a config.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@lishunyao97 lishunyao97 changed the title Remove expensive memory_full_info kernel call [PT 2.6 perf fix] Remove expensive memory_full_info kernel call Jul 21, 2025
Copy link

@ShaochenYu-YW ShaochenYu-YW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for fixing it!

@ShaochenYu-YW ShaochenYu-YW merged commit e187cad into pinterest/main-2.10.0 Jul 21, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants